package com.damon.g2048.utils;

import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;

public class AppInit {
	public static void initAdd(Context context) {
//		AppConnect.getInstance("961cd8a9a8d0a53dcf6cc09910f0b970", "goapk", context);
	}

	/* 获取当前应用的版本号 */

	public static int getVersionCode(Context context) {
		try {
			return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
		} catch (NameNotFoundException e) {
			e.printStackTrace();
		}
		return 0;
	}

	/* 获取当前应用的版本号 */

	public static String getVersionName(Context context) {
		try {
			return " V" + context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
		} catch (NameNotFoundException e) {
			e.printStackTrace();
		}
		return "";
	}
}
